<extend name="Base/common"/>

<block name="style">
    <link href="__CSS__/help.css" rel="stylesheet" type="text/css"/>

</block>

<block name="body">
    <div class="col-xs-12">
        <!--userinfo-->
        <include file="Public/user_info"/>
        <include file="Public/_top_menu"/>

    </div>


    <div class="col-md-9">
        <div class="bgwhite pull-left" style="width: 100%;margin-top: 0;padding-bottom: 20px;">
            <div class="help_h">
                <a href="{:U('help/usercenter/publish',array('uid'=>$uid))}" class="pull-left active" style="width: 140px;">发布的帮忙</a>
                <a href="{:U('help/usercenter/attend',array('uid'=>$uid))}" class="pull-left" style="width: 140px;">参加的帮忙</a>

            </div>

            <div class="help_list pull-left"  style="width: 100%;padding-left: 10px;padding-right:10px;">

                <if condition="!$list">
                    <div class="row">
                        <div class="col-xs-12">
                            <p class="text-muted" style="text-align: center; font-size: 3em;">
                                <br/><br/>
                                没有符合的帮忙～
                                <br/><br/><br/>
                            </p>
                        </div>
                    </div>
                </if>
                <volist name="list" id="vo">
                    <li class="col-lg-4 col-sm-6 help_one help_publish">
                        <dl style="max-width: 257px;width: 100%">
                            <dt>
                                <a class="help_img" href="{:U('help/index/detail',array('id'=>$vo['id']))}" target="_blank">
                                    <img src="{:getThumbImageById($vo['cover_id'],257,257)}"
                                         style="width:100%;max-width: 257px;height: 257px" class=""/>

                                    <div class="help_title_cav"></div>
                                    <div class="help_title">{$vo.title}</div>
                                </a>
                            </dt>
                            <php>if(check_can_edit($vo['id'])){</php>
                            <dd class="action">
                                <a href="{:U('help/index/ask',array('id'=>$vo['id']))}"
                                   class="col-xs-6 text-center pull-left">编辑</a>
                                <a class="col-xs-6 text-center del_help" data-url="{:U('help/Usercenter/del_help')}"
                                   data-id="{$vo['id']}">删除</a>
                            </dd>
                            <php>}</php>
                        </dl>
                    </li>
                </volist>

            </div>
            <div class="clearfix text-center">
                {:getPagination($totalCount,$r)}
            </div>
        </div>
    </div>
    <div class="col-md-3 col-xs-12">
        <div class="bgwhite" style="padding-bottom: 20px;margin-top: 0">
            {:W('Cooperate/lists',array('uid'=>$uid))}
        </div>
    </div>


    <script>
        $(function () {
            $('.del_help').click(function () {

                if(confirm('确定要删除么？')){
                    var obj = $(this);
                    var url = obj.attr('data-url');
                    var id = obj.attr('data-id');
                    $.post(url, {id: id}, function (res) {
                        handleAjax(res);
                    }, 'json')
                }

            })
        })
    </script>
</block>

